package com.dragon.array;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 泛型demo 案例
 *
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/5/19 10:46
 */
public class GenericDemo {

    public static void main(String[] args) {
        List<Number> numberList = new ArrayList<>();
        numberList.add(10D);
        numberList.add(11D);
        numberList.add(0.8F);
        List<Integer> integerList = new ArrayList<>();
        integerList.add(1);
        integerList.add(2);
        Collections.copy(numberList, integerList);
        System.out.println(numberList);
        List<? super Integer> list = new ArrayList<Integer>();
        list.add(10);
        System.out.println(list.get(0));
    }
}
